1. Field of the Invention
The present invention generally relates to managing a plurality of files and directories within a hierarchical file system, and in particular to a system and method for exchanging a first sub-hierarchy having a root directory coinciding with the root directory of a hierarchical file system with a sub-hierarchy included in the hierarchical file system.
2. Background of Related Art
A computer system is capable of storing large amounts of information, particularly on large capacity permanent storage media known as hard drives. File systems, particularly hierarchical file systems (HFSs), are currently widely used for providing organization of stored information so that desired information can be easily and quickly located and retrieved. In an HFS, user data is organized into variably sized units known as files. Files are then organized into groups known as directories. Directories may contain files and may also contain other directories, known as subdirectories. This structure forms a branching tree, or hierarchy. The topmost node of this tree is a special directory known as the root directory. The hard drive is divided into physical sections known as sectors. The hard drive can also be divided into one or more logical groups of sectors known as partitions. The HFS provides a mapping between disk sectors and user data, and maintains internal housekeeping information for storing the structural relationship between directories, sector usage tables, etc.
The file systems are typically stored on non-archival rotating storage media which are subject to mechanical failures of the media and/or drive thereof, endangering the viability of the data stored therein. In addition, inadvertent or malicious failures may occur in software within the file system itself (e.g., corruption) and/or data stored therein.
The operating system of the computer is typically provided with one or more file system drivers for enabling the operating system to interpret the file system's mapping for accessing and/or processing data stored within the file system. When a file system fails or becomes corrupted, the operating system may be unable, partially or completely, to interpret the file system. Furthermore, the operating system's data and executable code is typically stored in files of the file system, such that viability of the operating system is endangered when the file system fails or is corrupted.
A popular method for protection of stored data is copying (i.e., backing up) the file system to other media (i.e., backup) and recovering from a corruption occurrence by restoring the corrupted file system from the backup data. In both of these cases, the user is typically inconvenienced either during the backup process or the recovery process, since the computer system may not be useable during that time. Furthermore, the backup media may not be available when a recovery process is necessary. In addition, once the recovery process has been initiated, it is usually not possible to cancel or reverse the recovery.
In another popular method for protection against corruption within a file system, operating systems typically provide repair tools for checking the file system and performing repairs. If the operating system is itself stored on the corrupted file system, a situation may develop in which the operating system cannot be started because of the corruption, preventing use of the repair tool to repair the corruption.
Typically the repair tool returns the file system to a default condition, often overwriting or deleting files which are desirable to be kept, or making these files inaccessible by deleting the applications needed to access them. Furthermore, the standard repair tool typically checks and repairs a file system which resides in one partition. Backup data outside of the file system, such as backup data stored on another partition or medium, are not typically checked for corruption or repaired by the repair tool.
In order to increase speed and transparency for the backup or recovery processes, it is desirable to store one or more sets of backup data on the same disk that stores the original file system. Recently, such backup systems have been developed. However, a recovery process typically includes replacing the corrupted file system, in which the current version of the operating system resides, with a backed up file system having a backed up version of the operating system, without the ability to replace selected portions of the file system. Accordingly, uncorrupted portions of the operating system, application programs and user data which resided in the corrupted file system are replaced by corresponding backup data obtained at a previous point in time, causing a loss of updated information.
Another disadvantage to such existing backup systems is the requirement for a special device driver(s) for the backup medium, limiting compatibility between available different storage devices and the operating system.
Furthermore, one class of solution of existing backup systems copies the backup file system onto the same medium as the original file system, however the original and backup file systems are each stored in different respective partitions, causing the waste of unused disk space in each partition as well as lack of continuous monitoring and maintenance of the backup data by the repair tool.
It is an object of the present invention to provide a method and apparatus for maintaining multiple copies of a file system's data within the file system, and for replacing selectable portions of data from a copy currently being used as a working file system with corresponding data from a different copy by manipulating the file system's internal housekeeping information.
It is another object of this invention to provide a method of using an individual copy of the file system's data without affecting corresponding portions in another copy.
It is another object of the present invention to store the multiple copies of the file system in a single partition of a single physical or virtual storage medium.
It is still another object of the present invention to exchange an individual copy of the multiple copies of the file system's data that is being used as a working file system with another copy.
Finally, it is an object of the present invention to exchange an individual copy of the multiple copies of the file system's data with another copy, where the replacement is reversible.